package com.zmovie.framework.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 *
 * @TableName movie_comment
 */
@TableName(value ="movie_comment")
@Data
@ApiModel("电影评论")
public class MovieComment implements Serializable {
    /**
     * 电影评论id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("电影评论id")
    private Integer id;

    /**
     * 电影id
     */
    @NotNull(message = "未选择电影")
    @ApiModelProperty("电影id")
    private Integer movieId;

    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    private Integer userId;

    /**
     * 评论时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty("评论时间")
    private Date commentTime;

    /**
     * 评论内容
     */
    @NotBlank(message = "评论不能为空")
    @ApiModelProperty("评论内容")
    private String content;

    /**
     * 评分
     */
    @NotNull(message = "评分不能为空")
    @ApiModelProperty("评分")
    private Integer score;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}